public class Test1 {

    //1
    public static int  Add(int ... nums) {

        int sum = 0;

        for (int i : nums) {
            sum += i;
        }

        return sum;
    }

    //2
    public static int Add(int a, int ... nums) {

        int sum = a;

        for (int i : nums) {
            sum += i;
        }

        return sum;

    }

    //3
    public static int Add(int a, int b, int ... nums) {

        int sum = a + b;

        for (int i : nums) {
            sum += i;
        }

        return sum;

    }
    public static void main(String[] args) {

        Add(new int[]{1, 2, 3});

//        Add(1, 2, 3, 4);

    }
}
